﻿@model GitCandy.Models.CommitsModel

@{
    ViewBag.Title = string.Format(SR.Shared_TitleFormat, string.Format(SR.Repository_CommitsTitle, Model.RepositoryName ?? Model.Sha.ToShortSha(), Model.Path));
}

<h4>@SR.Repository_HistoryFor @Html.ActionLink(Model.RepositoryName, "Tree", Html.OverRoute(new { path = "" }))</h4>

@Html.Partial("_PathBar", Model.PathBar)

@foreach (var commit in Model.Commits)
{
    <div class="border-area">
        <div class="row">
            <div class="span9 pull-left">
                <div title="@commit.CommitMessageShort">@Html.ActionLink(commit.CommitMessageShort.ShortString(100), "Commit", Html.OverRoute(new { path = commit.Sha + "/" + Model.Path }))</div>
                <div>@commit.Author.Name @SR.Repository_AuthoredAt <span title="@commit.Author.When">@commit.Author.When.LocalDateTime</span></div>
                @if (commit.Author != commit.Committer)
                {
                    <div class="keep-space">@commit.Committer.Name @SR.Repository_CommittedAt <span title="@commit.Committer.When">@commit.Committer.When.LocalDateTime</span></div>
                }
            </div>
            <div class="span1 pull-right">
                <div class="pull-right">@Html.ActionLink(commit.Sha.ToShortSha(), "Commit", Html.OverRoute(new { path = commit.Sha }))</div>
                <div class="pull-right">@Html.ActionLink(SR.Repository_Tree, "Tree", Html.OverRoute(new { path = commit.Sha }))</div>
            </div>
        </div>
    </div>
}
@Html.Partial("../Shared/_Pager")
